#include "Parser.h"
#include "Error.h"
using namespace Lexer;
using namespace Parser;
using namespace myError;

int main(int argc, char* argv[]) {
    table["asd"] = 1.1;
    if(argc == 1){
        while(true){
            get_token();
            if(curr_tok == END) break;
            if(curr_tok == PRINT) continue;
            double val = expr(false, argc);
            if(val != -0.114514) cout << val << endl;
        }
    }else{
        char ch = 0;
        for(int i = 1; i < argc; ++i){
            input = new ifstream(argv[i]);
            while(input->peek() != EOF){
                get_token(input);
                if(curr_tok == END) break;
                if(curr_tok == PRINT) continue;
                double val = expr(false, argc);
                if(val != -0.114514) cout << val << endl;
            }
        }
    }

    return 0;
}
